home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / CIncludes / Appearance.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  65.7 KB  |  1,591 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Appearance.h
  3.  
  4.      Contains:    Appearance Manager Interfaces.
  5.  
  6.      Version:    Technology:    Allegro
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __APPEARANCE__
  18. #define __APPEARANCE__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23. #ifndef __QUICKDRAW__
  24. #include <Quickdraw.h>
  25. #endif
  26. #ifndef __TEXTEDIT__
  27. #include <TextEdit.h>
  28. #endif
  29. #ifndef __QDOFFSCREEN__
  30. #include <QDOffscreen.h>
  31. #endif
  32. #ifndef __MACWINDOWS__
  33. #include <MacWindows.h>
  34. #endif
  35. #ifndef __CONTROLS__
  36. #include <Controls.h>
  37. #endif
  38.  
  39. /*——————————————————————————————————————————————————————————————————————————————————*/
  40. /* Appearance Manager constants, etc.                                                */
  41. /*——————————————————————————————————————————————————————————————————————————————————*/
  42.  
  43.  
  44. #if PRAGMA_ONCE
  45. #pragma once
  46. #endif
  47.  
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51.  
  52. #if PRAGMA_IMPORT
  53. #pragma import on
  54. #endif
  55.  
  56. #if PRAGMA_STRUCT_ALIGN
  57.     #pragma options align=mac68k
  58. #elif PRAGMA_STRUCT_PACKPUSH
  59.     #pragma pack(push, 2)
  60. #elif PRAGMA_STRUCT_PACK
  61.     #pragma pack(2)
  62. #endif
  63.  
  64.  
  65. enum {
  66.                                                                 /* Appearance Trap Number */
  67.     _AppearanceDispatch            = 0xAA74
  68. };
  69.  
  70. /* Gestalt selector and values for the Appearance Manager */
  71.  
  72. enum {
  73.     gestaltAppearanceAttr        = FOUR_CHAR_CODE('appr'),
  74.     gestaltAppearanceExists        = 0,
  75.     gestaltAppearanceCompatMode    = 1
  76. };
  77.  
  78. /* Gestalt selector for determining Appearance Manager version      */
  79. /* If this selector does not exist, but gestaltAppearanceAttr     */
  80. /* does, it indicates that the 1.0 version is installed. This     */
  81. /* gestalt returns a BCD number representing the version of the     */
  82. /* Appearance Manager that is currently running, e.g. 0x0101 for */
  83. /* version 1.0.1.                                                 */
  84.  
  85. enum {
  86.     gestaltAppearanceVersion    = FOUR_CHAR_CODE('apvr')
  87. };
  88.  
  89. /* Appearance Manager Apple Events (1.1 and later)                 */
  90.  
  91. enum {
  92.     kAppearanceEventClass        = FOUR_CHAR_CODE('appr'),        /* Event Class */
  93.     kAEAppearanceChanged        = FOUR_CHAR_CODE('thme'),        /* Appearance changed (e.g. platinum to hi-tech) */
  94.     kAESystemFontChanged        = FOUR_CHAR_CODE('sysf'),        /* system font changed */
  95.     kAESmallSystemFontChanged    = FOUR_CHAR_CODE('ssfn'),        /* small system font changed */
  96.     kAEViewsFontChanged            = FOUR_CHAR_CODE('vfnt')        /* views font changed */
  97. };
  98.  
  99. /*——————————————————————————————————————————————————————————————————————————————————*/
  100. /* Appearance Manager file types                                                    */
  101. /*——————————————————————————————————————————————————————————————————————————————————*/
  102.  
  103. enum {
  104.     kThemeDataFileType            = FOUR_CHAR_CODE('thme'),        /* file type for theme files */
  105.     kThemePlatinumFileType        = FOUR_CHAR_CODE('pltn'),        /* file type for platinum appearance */
  106.     kThemeCustomThemesFileType    = FOUR_CHAR_CODE('scen'),        /* file type for user themes */
  107.     kThemeSoundTrackFileType    = FOUR_CHAR_CODE('tsnd')
  108. };
  109.  
  110. /* Appearance Manager Error Codes */
  111.  
  112. enum {
  113.     themeInvalidBrushErr        = -30560,                        /* pattern index invalid */
  114.     themeProcessRegisteredErr    = -30561,
  115.     themeProcessNotRegisteredErr = -30562,
  116.     themeBadTextColorErr        = -30563,
  117.     themeHasNoAccentsErr        = -30564,
  118.     themeBadCursorIndexErr        = -30565,
  119.     themeScriptFontNotFoundErr    = -30566,                        /* theme font requested for uninstalled script system */
  120.     themeMonitorDepthNotSupportedErr = -30567                    /* theme not supported at monitor depth */
  121. };
  122.  
  123.  
  124. enum {
  125.     kThemeBrushDialogBackgroundActive = 1,                        /* Dialogs */
  126.     kThemeBrushDialogBackgroundInactive = 2,                    /* Dialogs */
  127.     kThemeBrushAlertBackgroundActive = 3,
  128.     kThemeBrushAlertBackgroundInactive = 4,
  129.     kThemeBrushModelessDialogBackgroundActive = 5,
  130.     kThemeBrushModelessDialogBackgroundInactive = 6,
  131.     kThemeBrushUtilityWindowBackgroundActive = 7,                /* Miscellaneous */
  132.     kThemeBrushUtilityWindowBackgroundInactive = 8,                /* Miscellaneous */
  133.     kThemeBrushListViewSortColumnBackground = 9,                /* Finder */
  134.     kThemeBrushListViewBackground = 10,
  135.     kThemeBrushIconLabelBackground = 11,
  136.     kThemeBrushListViewSeparator = 12,
  137.     kThemeBrushChasingArrows    = 13,
  138.     kThemeBrushDragHilite        = 14,
  139.     kThemeBrushDocumentWindowBackground = 15,
  140.     kThemeBrushFinderWindowBackground = 16
  141. };
  142.  
  143. /* Brushes available in Appearance 1.1 or later */
  144.  
  145. enum {
  146.     kThemeBrushScrollBarDelimiterActive = 17,
  147.     kThemeBrushScrollBarDelimiterInactive = 18,
  148.     kThemeBrushFocusHighlight    = 19,
  149.     kThemeBrushPopupArrowActive    = 20,
  150.     kThemeBrushPopupArrowPressed = 21,
  151.     kThemeBrushPopupArrowInactive = 22,
  152.     kThemeBrushAppleGuideCoachmark = 23,
  153.     kThemeBrushIconLabelBackgroundSelected = 24,
  154.     kThemeBrushStaticAreaFill    = 25,
  155.     kThemeBrushActiveAreaFill    = 26,
  156.     kThemeBrushButtonFrameActive = 27,
  157.     kThemeBrushButtonFrameInactive = 28,
  158.     kThemeBrushButtonFaceActive    = 29,
  159.     kThemeBrushButtonFaceInactive = 30,
  160.     kThemeBrushButtonFacePressed = 31,
  161.     kThemeBrushButtonActiveDarkShadow = 32,
  162.     kThemeBrushButtonActiveDarkHighlight = 33,
  163.     kThemeBrushButtonActiveLightShadow = 34,
  164.     kThemeBrushButtonActiveLightHighlight = 35,
  165.     kThemeBrushButtonInactiveDarkShadow = 36,
  166.     kThemeBrushButtonInactiveDarkHighlight = 37,
  167.     kThemeBrushButtonInactiveLightShadow = 38,
  168.     kThemeBrushButtonInactiveLightHighlight = 39,
  169.     kThemeBrushButtonPressedDarkShadow = 40,
  170.     kThemeBrushButtonPressedDarkHighlight = 41,
  171.     kThemeBrushButtonPressedLightShadow = 42,
  172.     kThemeBrushButtonPressedLightHighlight = 43,
  173.     kThemeBrushBevelActiveLight    = 44,
  174.     kThemeBrushBevelActiveDark    = 45,
  175.     kThemeBrushBevelInactiveLight = 46,
  176.     kThemeBrushBevelInactiveDark = 47
  177. };
  178.  
  179. /* These values are meta-brushes, specific colors that do not         */
  180. /* change from theme to theme. You can use them instead of using    */
  181. /* direct RGB values.                                                 */
  182.  
  183. enum {
  184.     kThemeBrushBlack            = -1,
  185.     kThemeBrushWhite            = -2
  186. };
  187.  
  188. typedef SInt16                             ThemeBrush;
  189.  
  190. enum {
  191.     kThemeTextColorDialogActive    = 1,
  192.     kThemeTextColorDialogInactive = 2,
  193.     kThemeTextColorAlertActive    = 3,
  194.     kThemeTextColorAlertInactive = 4,
  195.     kThemeTextColorModelessDialogActive = 5,
  196.     kThemeTextColorModelessDialogInactive = 6,
  197.     kThemeTextColorWindowHeaderActive = 7,
  198.     kThemeTextColorWindowHeaderInactive = 8,
  199.     kThemeTextColorPlacardActive = 9,
  200.     kThemeTextColorPlacardInactive = 10,
  201.     kThemeTextColorPlacardPressed = 11,
  202.     kThemeTextColorPushButtonActive = 12,
  203.     kThemeTextColorPushButtonInactive = 13,
  204.     kThemeTextColorPushButtonPressed = 14,
  205.     kThemeTextColorBevelButtonActive = 15,
  206.     kThemeTextColorBevelButtonInactive = 16,
  207.     kThemeTextColorBevelButtonPressed = 17,
  208.     kThemeTextColorPopupButtonActive = 18,
  209.     kThemeTextColorPopupButtonInactive = 19,
  210.     kThemeTextColorPopupButtonPressed = 20,
  211.     kThemeTextColorIconLabel    = 21,
  212.     kThemeTextColorListView        = 22
  213. };
  214.  
  215. /* Text Colors available in Appearance 1.0.1 or later */
  216.  
  217. enum {
  218.     kThemeTextColorDocumentWindowTitleActive = 23,
  219.     kThemeTextColorDocumentWindowTitleInactive = 24,
  220.     kThemeTextColorMovableModalWindowTitleActive = 25,
  221.     kThemeTextColorMovableModalWindowTitleInactive = 26,
  222.     kThemeTextColorUtilityWindowTitleActive = 27,
  223.     kThemeTextColorUtilityWindowTitleInactive = 28,
  224.     kThemeTextColorPopupWindowTitleActive = 29,
  225.     kThemeTextColorPopupWindowTitleInactive = 30,
  226.     kThemeTextColorRootMenuActive = 31,
  227.     kThemeTextColorRootMenuSelected = 32,
  228.     kThemeTextColorRootMenuDisabled = 33,
  229.     kThemeTextColorMenuItemActive = 34,
  230.     kThemeTextColorMenuItemSelected = 35,
  231.     kThemeTextColorMenuItemDisabled = 36,
  232.     kThemeTextColorPopupLabelActive = 37,
  233.     kThemeTextColorPopupLabelInactive = 38
  234. };
  235.  
  236.  
  237. /* Text colors available in Appearance 1.1 or later */
  238.  
  239. enum {
  240.     kThemeTextColorTabFrontActive = 39,
  241.     kThemeTextColorTabNonFrontActive = 40,
  242.     kThemeTextColorTabNonFrontPressed = 41,
  243.     kThemeTextColorTabFrontInactive = 42,
  244.     kThemeTextColorTabNonFrontInactive = 43,
  245.     kThemeTextColorIconLabelSelected = 44,
  246.     kThemeTextColorBevelButtonStickyActive = 45,
  247.     kThemeTextColorBevelButtonStickyInactive = 46
  248. };
  249.  
  250. /* These values are specific colors that do not change from             */
  251. /* theme to theme. You can use them instead of using direct RGB values. */
  252.  
  253. enum {
  254.     kThemeTextColorBlack        = -1,
  255.     kThemeTextColorWhite        = -2
  256. };
  257.  
  258. typedef SInt16                             ThemeTextColor;
  259. /* States to draw primitives: disabled, active, and pressed (hilited) */
  260.  
  261. enum {
  262.     kThemeStateInactive            = 0,
  263.     kThemeStateActive            = 1,
  264.     kThemeStatePressed            = 2
  265. };
  266.  
  267. /* obsolete name */
  268.  
  269. enum {
  270.     kThemeStateDisabled            = 0
  271. };
  272.  
  273.  
  274. enum {
  275.     kThemeStatePressedUp        = 2,                            /* draw with up pressed        (increment/decrement buttons) */
  276.     kThemeStatePressedDown        = 3                                /* draw with down pressed    (increment/decrement buttons) */
  277. };
  278.  
  279. typedef UInt32                             ThemeDrawState;
  280. /*——————————————————————————————————————————————————————————————————————————————————*/
  281. /* Theme cursor selectors available in Appearance 1.1 or later                        */
  282. /*——————————————————————————————————————————————————————————————————————————————————*/
  283.  
  284. enum {
  285.     kThemeArrowCursor            = 0,
  286.     kThemeCopyArrowCursor        = 1,
  287.     kThemeAliasArrowCursor        = 2,
  288.     kThemeContextualMenuArrowCursor = 3,
  289.     kThemeIBeamCursor            = 4,
  290.     kThemeCrossCursor            = 5,
  291.     kThemePlusCursor            = 6,
  292.     kThemeWatchCursor            = 7,                            /* Can Animate */
  293.     kThemeClosedHandCursor        = 8,
  294.     kThemeOpenHandCursor        = 9,
  295.     kThemePointingHandCursor    = 10,
  296.     kThemeCountingUpHandCursor    = 11,                            /* Can Animate */
  297.     kThemeCountingDownHandCursor = 12,                            /* Can Animate */
  298.     kThemeCountingUpAndDownHandCursor = 13,                        /* Can Animate */
  299.     kThemeSpinningCursor        = 14,                            /* Can Animate */
  300.     kThemeResizeLeftCursor        = 15,
  301.     kThemeResizeRightCursor        = 16,
  302.     kThemeResizeLeftRightCursor    = 17
  303. };
  304.  
  305. typedef UInt32                             ThemeCursor;
  306. /*——————————————————————————————————————————————————————————————————————————————————*/
  307. /* Theme menu bar drawing states                                                    */
  308. /*——————————————————————————————————————————————————————————————————————————————————*/
  309.  
  310. enum {
  311.     kThemeMenuBarNormal            = 0,
  312.     kThemeMenuBarSelected        = 1
  313. };
  314.  
  315. typedef UInt16                             ThemeMenuBarState;
  316. /* attributes */
  317.  
  318. enum {
  319.     kThemeMenuSquareMenuBar        = (1 << 0)
  320. };
  321.  
  322. /*——————————————————————————————————————————————————————————————————————————————————*/
  323. /* Theme menu drawing states                                                        */
  324. /*——————————————————————————————————————————————————————————————————————————————————*/
  325.  
  326. enum {
  327.     kThemeMenuActive            = 0,
  328.     kThemeMenuSelected            = 1,
  329.     kThemeMenuInactive            = 3
  330. };
  331.  
  332. /* obsolete name */
  333.  
  334. enum {
  335.     kThemeMenuDisabled            = 3
  336. };
  337.  
  338. typedef UInt16                             ThemeMenuState;
  339. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  340. /* MenuType: add kThemeMenuTypeInactive to menu type for DrawThemeMenuBackground if entire     */
  341. /* menu is inactive                                                                            */
  342. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  343.  
  344. enum {
  345.     kThemeMenuTypePullDown        = 0,
  346.     kThemeMenuTypePopUp            = 1,
  347.     kThemeMenuTypeHierarchical    = 2,
  348.     kThemeMenuTypeInactive        = 0x0100
  349. };
  350.  
  351. typedef UInt16                             ThemeMenuType;
  352.  
  353. enum {
  354.     kThemeMenuItemPlain            = 0,
  355.     kThemeMenuItemHierarchical    = 1,                            /* item has hierarchical arrow*/
  356.     kThemeMenuItemScrollUpArrow    = 2,                            /* for scrollable menus, indicates item is scroller*/
  357.     kThemeMenuItemScrollDownArrow = 3,
  358.     kThemeMenuItemAtTop            = 0x0100,                        /* indicates item is being drawn at top of menu*/
  359.     kThemeMenuItemAtBottom        = 0x0200,                        /* indicates item is being drawn at bottom of menu*/
  360.     kThemeMenuItemHierBackground = 0x0400,                        /* item is within a hierarchical menu*/
  361.     kThemeMenuItemPopUpBackground = 0x0800,                        /* item is within a popped up menu*/
  362.     kThemeMenuItemHasIcon        = 0x8000                        /* add into non-arrow type when icon present.*/
  363. };
  364.  
  365. typedef UInt16                             ThemeMenuItemType;
  366. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  367. /* Theme Backgrounds                                                                        */
  368. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  369.  
  370. enum {
  371.     kThemeBackgroundTabPane        = 1,
  372.     kThemeBackgroundPlacard        = 2,
  373.     kThemeBackgroundWindowHeader = 3,
  374.     kThemeBackgroundListViewWindowHeader = 4
  375. };
  376.  
  377. typedef UInt32                             ThemeBackgroundKind;
  378. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  379. /* Theme Collection tags for Get/SetTheme                                                    */
  380. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  381.  
  382. enum {
  383.     kThemeNameTag                = FOUR_CHAR_CODE('name'),        /* Str255*/
  384.     kThemeAppearanceFileNameTag    = FOUR_CHAR_CODE('thme'),        /* Str255*/
  385.     kThemeVariantNameTag        = FOUR_CHAR_CODE('varn'),        /* Str255*/
  386.     kThemeSystemFontTag            = FOUR_CHAR_CODE('lgsf'),        /* Str255*/
  387.     kThemeSmallSystemFontTag    = FOUR_CHAR_CODE('smsf'),        /* Str255*/
  388.     kThemeViewsFontTag            = FOUR_CHAR_CODE('vfnt'),        /* Str255*/
  389.     kThemeViewsFontSizeTag        = FOUR_CHAR_CODE('vfsz'),        /* SInt16*/
  390.     kThemeDesktopPatternNameTag    = FOUR_CHAR_CODE('patn'),        /* Str255*/
  391.     kThemeDesktopPatternTag        = FOUR_CHAR_CODE('patt'),        /* <variable-length data> (flattened pattern)*/
  392.     kThemeDesktopPictureNameTag    = FOUR_CHAR_CODE('dpnm'),        /* Str255*/
  393.     kThemeDesktopPictureAliasTag = FOUR_CHAR_CODE('dpal'),        /* <alias handle>*/
  394.     kThemeDesktopPictureAlignmentTag = FOUR_CHAR_CODE('dpan'),    /* UInt32*/
  395.     kThemeHighlightColorNameTag    = FOUR_CHAR_CODE('hcnm'),        /* Str255*/
  396.     kThemeHighlightColorTag        = FOUR_CHAR_CODE('hcol'),        /* RGBColor*/
  397.     kThemeExamplePictureIDTag    = FOUR_CHAR_CODE('epic'),        /* SInt16*/
  398.     kThemeSoundsEnabledTag        = FOUR_CHAR_CODE('snds'),        /* Boolean*/
  399.     kThemeSoundTrackNameTag        = FOUR_CHAR_CODE('sndt'),        /* Str255*/
  400.     kThemeSoundMaskTag            = FOUR_CHAR_CODE('smsk'),        /* UInt32*/
  401.     kThemeUserDefinedTag        = FOUR_CHAR_CODE('user'),        /* Boolean (this should _always_ be true if present - used by Control Panel).*/
  402.     kThemeScrollBarArrowStyleTag = FOUR_CHAR_CODE('sbar'),        /* ThemeScrollBarArrowStyle*/
  403.     kThemeScrollBarThumbStyleTag = FOUR_CHAR_CODE('sbth'),        /* ThemeScrollBarThumbStyle*/
  404.     kThemeSmoothFontEnabledTag    = FOUR_CHAR_CODE('smoo'),        /* Boolean*/
  405.     kThemeSmoothFontMinSizeTag    = FOUR_CHAR_CODE('smos'),        /* UInt16 (must be >= 12 and <= 24)*/
  406.     kThemeDblClickCollapseTag    = FOUR_CHAR_CODE('coll')        /* Boolean*/
  407. };
  408.  
  409. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  410. /* Theme Control Settings                                                                    */
  411. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  412.  
  413. enum {
  414.     kThemeCheckBoxClassicX        = 0,                            /* check box with an 'X'*/
  415.     kThemeCheckBoxCheckMark        = 1                                /* check box with a real check mark*/
  416. };
  417.  
  418. typedef UInt16                             ThemeCheckBoxStyle;
  419.  
  420. enum {
  421.     kThemeScrollBarArrowsSingle    = 0,                            /* single arrow on each end*/
  422.     kThemeScrollBarArrowsLowerRight = 1                            /* double arrows only on right or bottom*/
  423. };
  424.  
  425. typedef UInt16                             ThemeScrollBarArrowStyle;
  426.  
  427. enum {
  428.     kThemeScrollBarThumbNormal    = 0,                            /* normal, classic thumb size*/
  429.     kThemeScrollBarThumbProportional = 1                        /* proportional thumbs*/
  430. };
  431.  
  432. typedef UInt16                             ThemeScrollBarThumbStyle;
  433. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  434. /* Font constants                                                                            */
  435. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  436.  
  437. enum {
  438.     kThemeSystemFont            = 0,
  439.     kThemeSmallSystemFont        = 1,
  440.     kThemeSmallEmphasizedSystemFont = 2,
  441.     kThemeViewsFont                = 3
  442. };
  443.  
  444. typedef UInt16                             ThemeFontID;
  445. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  446. /* Tab constants                                                                            */
  447. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  448.  
  449. enum {
  450.     kThemeTabNonFront            = 0,
  451.     kThemeTabNonFrontPressed    = 1,
  452.     kThemeTabNonFrontInactive    = 2,
  453.     kThemeTabFront                = 3,
  454.     kThemeTabFrontInactive        = 4
  455. };
  456.  
  457. typedef UInt16                             ThemeTabStyle;
  458.  
  459. enum {
  460.     kThemeTabNorth                = 0,
  461.     kThemeTabSouth                = 1,
  462.     kThemeTabEast                = 2,
  463.     kThemeTabWest                = 3
  464. };
  465.  
  466. typedef UInt16                             ThemeTabDirection;
  467. /* NOTE ON TAB HEIGHT                                                                        */
  468. /* Use the kThemeSmallTabHeightMax and kThemeLargeTabHeightMax when calculating the rects    */
  469. /* to draw tabs into. This height includes the tab frame overlap. Tabs that are not in the    */
  470. /* front are only drawn down to where they meet the frame, as if the height was just        */
  471. /* kThemeLargeTabHeight, for example, as opposed to the ...Max constant. Remember that for    */
  472. /* East and West tabs, the height referred to below is actually the width.                    */
  473.  
  474. enum {
  475.     kThemeSmallTabHeight        = 16,                            /* amount small tabs protrude from frame.*/
  476.     kThemeLargeTabHeight        = 21,                            /* amount large tabs protrude from frame.*/
  477.     kThemeTabPaneOverlap        = 3,                            /* amount tabs overlap frame.*/
  478.     kThemeSmallTabHeightMax        = 19,                            /* small tab height + overlap*/
  479.     kThemeLargeTabHeightMax        = 24                            /* large tab height + overlap*/
  480. };
  481.  
  482. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  483. /* Track kinds                                                                                */
  484. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  485.  
  486. enum {
  487.     kThemeScrollBar                = 0,
  488.     kThemeSmallScrollBar        = 1,
  489.     kThemeSlider                = 2,
  490.     kThemeProgressBar            = 3,
  491.     kThemeIndeterminateBar        = 4
  492. };
  493.  
  494. typedef UInt16                             ThemeTrackKind;
  495. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  496. /* Track enable states                                                                        */
  497. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  498.  
  499. enum {
  500.                                                                 /* track states */
  501.     kThemeTrackActive            = 0,
  502.     kThemeTrackDisabled            = 1,
  503.     kThemeTrackNothingToScroll    = 2
  504. };
  505.  
  506. typedef UInt8                             ThemeTrackEnableState;
  507. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  508. /* Track pressed states                                                                        */
  509. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  510.  
  511. enum {
  512.                                                                 /* press states (ignored unless track is active) */
  513.     kThemeLeftOutsideArrowPressed = 0x01,
  514.     kThemeLeftInsideArrowPressed = 0x02,
  515.     kThemeLeftTrackPressed        = 0x04,
  516.     kThemeThumbPressed            = 0x08,
  517.     kThemeRightTrackPressed        = 0x10,
  518.     kThemeRightInsideArrowPressed = 0x20,
  519.     kThemeRightOutsideArrowPressed = 0x40,
  520.     kThemeTopOutsideArrowPressed = kThemeLeftOutsideArrowPressed,
  521.     kThemeTopInsideArrowPressed    = kThemeLeftInsideArrowPressed,
  522.     kThemeTopTrackPressed        = kThemeLeftTrackPressed,
  523.     kThemeBottomTrackPressed    = kThemeRightTrackPressed,
  524.     kThemeBottomInsideArrowPressed = kThemeRightInsideArrowPressed,
  525.     kThemeBottomOutsideArrowPressed = kThemeRightOutsideArrowPressed
  526. };
  527.  
  528. typedef UInt8                             ThemeTrackPressState;
  529. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  530. /* Thumb directions                                                                            */
  531. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  532.  
  533. enum {
  534.                                                                 /* thumb direction */
  535.     kThemeThumbPlain            = 0,
  536.     kThemeThumbUpward            = 1,
  537.     kThemeThumbDownward            = 2
  538. };
  539.  
  540. typedef UInt8                             ThemeThumbDirection;
  541. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  542. /* Track attributes                                                                            */
  543. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  544.  
  545. enum {
  546.     kThemeTrackHorizontal        = (1 << 0),                        /* track is drawn horizontally*/
  547.     kThemeTrackRightToLeft        = (1 << 1),                        /* track progresses from right to left*/
  548.     kThemeTrackShowThumb        = (1 << 2)                        /* track's thumb should be drawn*/
  549. };
  550.  
  551. typedef UInt16                             ThemeTrackAttributes;
  552. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  553. /* Track info block                                                                            */
  554. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  555.  
  556. struct ScrollBarTrackInfo {
  557.     SInt32                             viewsize;                    /* current view range size */
  558.     ThemeTrackPressState             pressState;                    /* pressed parts state */
  559. };
  560. typedef struct ScrollBarTrackInfo        ScrollBarTrackInfo;
  561.  
  562. struct SliderTrackInfo {
  563.     ThemeThumbDirection             thumbDir;                    /* thumb direction */
  564.     ThemeTrackPressState             pressState;                    /* pressed parts state */
  565. };
  566. typedef struct SliderTrackInfo            SliderTrackInfo;
  567.  
  568. struct ProgressTrackInfo {
  569.     UInt8                             phase;                        /* phase for indeterminate progress */
  570. };
  571. typedef struct ProgressTrackInfo        ProgressTrackInfo;
  572.  
  573. struct ThemeTrackDrawInfo {
  574.     ThemeTrackKind                     kind;                        /* what kind of track this info is for */
  575.     Rect                             bounds;                        /* track basis rectangle */
  576.     SInt32                             min;                        /* min track value */
  577.     SInt32                             max;                        /* max track value */
  578.     SInt32                             value;                        /* current thumb value */
  579.     UInt32                             reserved;
  580.  
  581.     ThemeTrackAttributes             attributes;                    /* various track attributes */
  582.     ThemeTrackEnableState             enableState;                /* enable state */
  583.     UInt8                             filler1;
  584.  
  585.     union {
  586.         ScrollBarTrackInfo                 scrollbar;
  587.         SliderTrackInfo                 slider;
  588.         ProgressTrackInfo                 progress;
  589.     }                                 trackInfo;
  590. };
  591. typedef struct ThemeTrackDrawInfo        ThemeTrackDrawInfo;
  592. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  593. /* ThemeWindowAttributes                                                                    */
  594. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  595.  
  596. enum {
  597.     kThemeWindowHasGrow            = (1 << 0),                        /* can the size of the window be changed by the user? */
  598.     kThemeWindowHasHorizontalZoom = (1 << 3),                    /* window can zoom only horizontally */
  599.     kThemeWindowHasVerticalZoom    = (1 << 4),                        /* window can zoom only vertically */
  600.     kThemeWindowHasFullZoom        = kThemeWindowHasHorizontalZoom + kThemeWindowHasVerticalZoom, /* window zooms in all directions */
  601.     kThemeWindowHasCloseBox        = (1 << 5),                        /* window has a close box */
  602.     kThemeWindowHasCollapseBox    = (1 << 6),                        /* window has a collapse box */
  603.     kThemeWindowHasTitleText    = (1 << 7),                        /* window has a title/title icon */
  604.     kThemeWindowIsCollapsed        = (1 << 8)                        /* window is in the collapsed state */
  605. };
  606.  
  607.  
  608. typedef UInt32                             ThemeWindowAttributes;
  609. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  610. /* Window Types Supported by the Appearance Manager                                            */
  611. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  612.  
  613. enum {
  614.     kThemeDocumentWindow        = 0,
  615.     kThemeDialogWindow            = 1,
  616.     kThemeMovableDialogWindow    = 2,
  617.     kThemeAlertWindow            = 3,
  618.     kThemeMovableAlertWindow    = 4,
  619.     kThemePlainDialogWindow        = 5,
  620.     kThemeShadowDialogWindow    = 6,
  621.     kThemePopupWindow            = 7,
  622.     kThemeUtilityWindow            = 8,
  623.     kThemeUtilitySideWindow        = 9
  624. };
  625.  
  626. typedef UInt16                             ThemeWindowType;
  627. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  628. /* Window Widgets Supported by the Appearance Manager                                        */
  629. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  630.  
  631. enum {
  632.     kThemeWidgetCloseBox        = 0,
  633.     kThemeWidgetZoomBox            = 1,
  634.     kThemeWidgetCollapseBox        = 2
  635. };
  636.  
  637. typedef UInt16                             ThemeTitleBarWidget;
  638. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  639. /* Popup arrow orientations                                                                    */
  640. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  641.  
  642. enum {
  643.     kThemeArrowLeft                = 0,
  644.     kThemeArrowDown                = 1,
  645.     kThemeArrowRight            = 2,
  646.     kThemeArrowUp                = 3
  647. };
  648.  
  649. typedef UInt16                             ThemeArrowOrientation;
  650. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  651. /* Popup arrow sizes                                                                        */
  652. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  653.  
  654. enum {
  655.     kThemeArrow3pt                = 0,
  656.     kThemeArrow5pt                = 1,
  657.     kThemeArrow7pt                = 2,
  658.     kThemeArrow9pt                = 3
  659. };
  660.  
  661. typedef UInt16                             ThemePopupArrowSize;
  662. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  663. /* Grow box directions                                                                        */
  664. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  665.  
  666. enum {
  667.     kThemeGrowLeft                = (1 << 0),                        /* can grow to the left */
  668.     kThemeGrowRight                = (1 << 1),                        /* can grow to the right */
  669.     kThemeGrowUp                = (1 << 2),                        /* can grow up */
  670.     kThemeGrowDown                = (1 << 3)                        /* can grow down */
  671. };
  672.  
  673. typedef UInt16                             ThemeGrowDirection;
  674. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  675. /* Button kinds                                                                                */
  676. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  677.  
  678. enum {
  679.     kThemePushButton            = 0,
  680.     kThemeCheckBox                = 1,
  681.     kThemeRadioButton            = 2,
  682.     kThemeBevelButton            = 3,                            /* bevel button (obsolete) */
  683.     kThemeArrowButton            = 4,                            /* popup button without text  (no label) */
  684.     kThemePopupButton            = 5,                            /* popup button */
  685.     kThemeDisclosureButton        = 6,
  686.     kThemeIncDecButton            = 7,                            /* increment/decrement buttons  (no label) */
  687.     kThemeSmallBevelButton        = 8,                            /* small-shadow bevel button */
  688.     kThemeMediumBevelButton        = 3,                            /* med-shadow bevel button */
  689.     kThemeLargeBevelButton        = 9                                /* large-shadow bevel button */
  690. };
  691.  
  692. typedef UInt16                             ThemeButtonKind;
  693. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  694. /* Common button values                                                                        */
  695. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  696.  
  697. enum {
  698.     kThemeButtonOff                = 0,
  699.     kThemeButtonOn                = 1,
  700.     kThemeButtonMixed            = 2,
  701.     kThemeDisclosureRight        = 0,
  702.     kThemeDisclosureDown        = 1,
  703.     kThemeDisclosureLeft        = 2
  704. };
  705.  
  706. typedef UInt16                             ThemeButtonValue;
  707. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  708. /* Button adornment types                                                                    */
  709. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  710.  
  711. enum {
  712.     kThemeAdornmentNone            = 0,
  713.     kThemeAdornmentDefault        = (1 << 0),                        /* if set, draw default ornamentation ( push button only ) */
  714.     kThemeAdornmentFocus        = (1 << 2),                        /* if set, draw focus */
  715.     kThemeAdornmentRightToLeft    = (1 << 4),                        /* if set, draw right to left label */
  716.     kThemeAdornmentDrawIndicatorOnly = (1 << 5)                    /* if set, don't draw or erase label ( radio, check, disclosure ) */
  717. };
  718.  
  719. typedef UInt16                             ThemeButtonAdornment;
  720. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  721. /* Button drawing info block                                                                */
  722. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  723.  
  724. struct ThemeButtonDrawInfo {
  725.     ThemeDrawState                     state;
  726.     ThemeButtonValue                 value;
  727.     ThemeButtonAdornment             adornment;
  728. };
  729. typedef struct ThemeButtonDrawInfo        ThemeButtonDrawInfo;
  730. typedef ThemeButtonDrawInfo *            ThemeButtonDrawInfoPtr;
  731. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  732. /* Sound Support                                                                            */
  733. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  734. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  735. /* Sound classes                                                                            */
  736. /*                                                                                            */
  737. /* You can use the constants below to set what sounds are active using the SetTheme API.    */
  738. /* Use these with the kThemeSoundMask tag.                                                    */
  739. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  740.  
  741. enum {
  742.     kThemeNoSounds                = 0,
  743.     kThemeWindowSoundsMask        = (1 << 0),
  744.     kThemeMenuSoundsMask        = (1 << 1),
  745.     kThemeControlSoundsMask        = (1 << 2),
  746.     kThemeFinderSoundsMask        = (1 << 3)
  747. };
  748.  
  749.  
  750. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  751. /* Drag Sounds                                                                                */
  752. /*                                                                                            */
  753. /* Drag sounds are looped for the duration of the drag.                                        */
  754. /*                                                                                            */
  755. /* Call BeginThemeDragSound at the start of the drag.                                        */
  756. /* Call EndThemeDragSound when the drag has finished.                                        */
  757. /*                                                                                            */
  758. /* Note that in order to maintain a consistent user experience, only one drag sound may     */
  759. /* occur at a time.  The sound should be attached to a mouse action, start after the         */
  760. /* mouse goes down and stop when the mouse is released.                                        */
  761. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  762.  
  763. enum {
  764.     kThemeDragSoundNone            = 0,
  765.     kThemeDragSoundMoveWindow    = FOUR_CHAR_CODE('wmov'),
  766.     kThemeDragSoundGrowWindow    = FOUR_CHAR_CODE('wgro'),
  767.     kThemeDragSoundMoveUtilWindow = FOUR_CHAR_CODE('umov'),
  768.     kThemeDragSoundGrowUtilWindow = FOUR_CHAR_CODE('ugro'),
  769.     kThemeDragSoundMoveDialog    = FOUR_CHAR_CODE('dmov'),
  770.     kThemeDragSoundMoveAlert    = FOUR_CHAR_CODE('amov'),
  771.     kThemeDragSoundMoveIcon        = FOUR_CHAR_CODE('imov'),
  772.     kThemeDragSoundSliderThumb    = FOUR_CHAR_CODE('slth'),
  773.     kThemeDragSoundSliderGhost    = FOUR_CHAR_CODE('slgh'),
  774.     kThemeDragSoundScrollBarThumb = FOUR_CHAR_CODE('sbth'),
  775.     kThemeDragSoundScrollBarGhost = FOUR_CHAR_CODE('sbgh'),
  776.     kThemeDragSoundScrollBarArrowDecreasing = FOUR_CHAR_CODE('sbad'),
  777.     kThemeDragSoundScrollBarArrowIncreasing = FOUR_CHAR_CODE('sbai'),
  778.     kThemeDragSoundDragging        = FOUR_CHAR_CODE('drag')
  779. };
  780.  
  781.  
  782. typedef OSType                             ThemeDragSoundKind;
  783. /*——————————————————————————————————————————————————————————————————————————*/
  784. /* State-change sounds                                                        */
  785. /*                                                                            */
  786. /* State-change sounds are played asynchonously as a one-shot.                */
  787. /*                                                                            */
  788. /* Call PlayThemeSound to play the sound.  The sound will play                */
  789. /* asynchronously until complete, then stop automatically.                    */
  790. /*——————————————————————————————————————————————————————————————————————————*/
  791.  
  792. enum {
  793.     kThemeSoundNone                = 0,
  794.     kThemeSoundMenuOpen            = FOUR_CHAR_CODE('mnuo'),        /* menu sounds */
  795.     kThemeSoundMenuClose        = FOUR_CHAR_CODE('mnuc'),
  796.     kThemeSoundMenuItemHilite    = FOUR_CHAR_CODE('mnui'),
  797.     kThemeSoundMenuItemRelease    = FOUR_CHAR_CODE('mnus'),
  798.     kThemeSoundWindowClosePress    = FOUR_CHAR_CODE('wclp'),        /* window sounds */
  799.     kThemeSoundWindowCloseEnter    = FOUR_CHAR_CODE('wcle'),
  800.     kThemeSoundWindowCloseExit    = FOUR_CHAR_CODE('wclx'),
  801.     kThemeSoundWindowCloseRelease = FOUR_CHAR_CODE('wclr'),
  802.     kThemeSoundWindowZoomPress    = FOUR_CHAR_CODE('wzmp'),
  803.     kThemeSoundWindowZoomEnter    = FOUR_CHAR_CODE('wzme'),
  804.     kThemeSoundWindowZoomExit    = FOUR_CHAR_CODE('wzmx'),
  805.     kThemeSoundWindowZoomRelease = FOUR_CHAR_CODE('wzmr'),
  806.     kThemeSoundWindowCollapsePress = FOUR_CHAR_CODE('wcop'),
  807.     kThemeSoundWindowCollapseEnter = FOUR_CHAR_CODE('wcoe'),
  808.     kThemeSoundWindowCollapseExit = FOUR_CHAR_CODE('wcox'),
  809.     kThemeSoundWindowCollapseRelease = FOUR_CHAR_CODE('wcor'),
  810.     kThemeSoundWindowDragBoundary = FOUR_CHAR_CODE('wdbd'),
  811.     kThemeSoundUtilWinClosePress = FOUR_CHAR_CODE('uclp'),        /* utility window sounds */
  812.     kThemeSoundUtilWinCloseEnter = FOUR_CHAR_CODE('ucle'),
  813.     kThemeSoundUtilWinCloseExit    = FOUR_CHAR_CODE('uclx'),
  814.     kThemeSoundUtilWinCloseRelease = FOUR_CHAR_CODE('uclr'),
  815.     kThemeSoundUtilWinZoomPress    = FOUR_CHAR_CODE('uzmp'),
  816.     kThemeSoundUtilWinZoomEnter    = FOUR_CHAR_CODE('uzme'),
  817.     kThemeSoundUtilWinZoomExit    = FOUR_CHAR_CODE('uzmx'),
  818.     kThemeSoundUtilWinZoomRelease = FOUR_CHAR_CODE('uzmr'),
  819.     kThemeSoundUtilWinCollapsePress = FOUR_CHAR_CODE('ucop'),
  820.     kThemeSoundUtilWinCollapseEnter = FOUR_CHAR_CODE('ucoe'),
  821.     kThemeSoundUtilWinCollapseExit = FOUR_CHAR_CODE('ucox'),
  822.     kThemeSoundUtilWinCollapseRelease = FOUR_CHAR_CODE('ucor'),
  823.     kThemeSoundUtilWinDragBoundary = FOUR_CHAR_CODE('udbd'),
  824.     kThemeSoundWindowOpen        = FOUR_CHAR_CODE('wopn'),        /* window close and zoom action */
  825.     kThemeSoundWindowClose        = FOUR_CHAR_CODE('wcls'),
  826.     kThemeSoundWindowZoomIn        = FOUR_CHAR_CODE('wzmi'),
  827.     kThemeSoundWindowZoomOut    = FOUR_CHAR_CODE('wzmo'),
  828.     kThemeSoundWindowCollapseUp    = FOUR_CHAR_CODE('wcol'),
  829.     kThemeSoundWindowCollapseDown = FOUR_CHAR_CODE('wexp'),
  830.     kThemeSoundWindowActivate    = FOUR_CHAR_CODE('wact'),
  831.     kThemeSoundUtilWindowOpen    = FOUR_CHAR_CODE('uopn'),
  832.     kThemeSoundUtilWindowClose    = FOUR_CHAR_CODE('ucls'),
  833.     kThemeSoundUtilWindowZoomIn    = FOUR_CHAR_CODE('uzmi'),
  834.     kThemeSoundUtilWindowZoomOut = FOUR_CHAR_CODE('uzmo'),
  835.     kThemeSoundUtilWindowCollapseUp = FOUR_CHAR_CODE('ucol'),
  836.     kThemeSoundUtilWindowCollapseDown = FOUR_CHAR_CODE('uexp'),
  837.     kThemeSoundUtilWindowActivate = FOUR_CHAR_CODE('uact'),
  838.     kThemeSoundDialogOpen        = FOUR_CHAR_CODE('dopn'),
  839.     kThemeSoundDialogClose        = FOUR_CHAR_CODE('dlgc'),
  840.     kThemeSoundAlertOpen        = FOUR_CHAR_CODE('aopn'),
  841.     kThemeSoundAlertClose        = FOUR_CHAR_CODE('altc'),
  842.     kThemeSoundPopupWindowOpen    = FOUR_CHAR_CODE('pwop'),
  843.     kThemeSoundPopupWindowClose    = FOUR_CHAR_CODE('pwcl'),
  844.     kThemeSoundButtonPress        = FOUR_CHAR_CODE('btnp'),        /* button */
  845.     kThemeSoundButtonEnter        = FOUR_CHAR_CODE('btne'),
  846.     kThemeSoundButtonExit        = FOUR_CHAR_CODE('btnx'),
  847.     kThemeSoundButtonRelease    = FOUR_CHAR_CODE('btnr'),
  848.     kThemeSoundDefaultButtonPress = FOUR_CHAR_CODE('dbtp'),        /* default button */
  849.     kThemeSoundDefaultButtonEnter = FOUR_CHAR_CODE('dbte'),
  850.     kThemeSoundDefaultButtonExit = FOUR_CHAR_CODE('dbtx'),
  851.     kThemeSoundDefaultButtonRelease = FOUR_CHAR_CODE('dbtr'),
  852.     kThemeSoundCancelButtonPress = FOUR_CHAR_CODE('cbtp'),        /* cancel button */
  853.     kThemeSoundCancelButtonEnter = FOUR_CHAR_CODE('cbte'),
  854.     kThemeSoundCancelButtonExit    = FOUR_CHAR_CODE('cbtx'),
  855.     kThemeSoundCancelButtonRelease = FOUR_CHAR_CODE('cbtr'),
  856.     kThemeSoundCheckboxPress    = FOUR_CHAR_CODE('chkp'),        /* checkboxes */
  857.     kThemeSoundCheckboxEnter    = FOUR_CHAR_CODE('chke'),
  858.     kThemeSoundCheckboxExit        = FOUR_CHAR_CODE('chkx'),
  859.     kThemeSoundCheckboxRelease    = FOUR_CHAR_CODE('chkr'),
  860.     kThemeSoundRadioPress        = FOUR_CHAR_CODE('radp'),        /* radio buttons */
  861.     kThemeSoundRadioEnter        = FOUR_CHAR_CODE('rade'),
  862.     kThemeSoundRadioExit        = FOUR_CHAR_CODE('radx'),
  863.     kThemeSoundRadioRelease        = FOUR_CHAR_CODE('radr'),
  864.     kThemeSoundScrollArrowPress    = FOUR_CHAR_CODE('sbap'),        /* scroll bars */
  865.     kThemeSoundScrollArrowEnter    = FOUR_CHAR_CODE('sbae'),
  866.     kThemeSoundScrollArrowExit    = FOUR_CHAR_CODE('sbax'),
  867.     kThemeSoundScrollArrowRelease = FOUR_CHAR_CODE('sbar'),
  868.     kThemeSoundScrollEndOfTrack    = FOUR_CHAR_CODE('sbte'),
  869.     kThemeSoundScrollTrackPress    = FOUR_CHAR_CODE('sbtp'),
  870.     kThemeSoundSliderEndOfTrack    = FOUR_CHAR_CODE('slte'),        /* sliders */
  871.     kThemeSoundSliderTrackPress    = FOUR_CHAR_CODE('sltp'),
  872.     kThemeSoundBalloonOpen        = FOUR_CHAR_CODE('blno'),        /* help balloons */
  873.     kThemeSoundBalloonClose        = FOUR_CHAR_CODE('blnc'),
  874.     kThemeSoundBevelPress        = FOUR_CHAR_CODE('bevp'),        /* Bevel buttons */
  875.     kThemeSoundBevelEnter        = FOUR_CHAR_CODE('beve'),
  876.     kThemeSoundBevelExit        = FOUR_CHAR_CODE('bevx'),
  877.     kThemeSoundBevelRelease        = FOUR_CHAR_CODE('bevr'),
  878.     kThemeSoundLittleArrowUpPress = FOUR_CHAR_CODE('laup'),        /* Little Arrows */
  879.     kThemeSoundLittleArrowDnPress = FOUR_CHAR_CODE('ladp'),
  880.     kThemeSoundLittleArrowEnter    = FOUR_CHAR_CODE('lare'),
  881.     kThemeSoundLittleArrowExit    = FOUR_CHAR_CODE('larx'),
  882.     kThemeSoundLittleArrowUpRelease = FOUR_CHAR_CODE('laur'),
  883.     kThemeSoundLittleArrowDnRelease = FOUR_CHAR_CODE('ladr'),
  884.     kThemeSoundPopupPress        = FOUR_CHAR_CODE('popp'),        /* Popup Buttons */
  885.     kThemeSoundPopupEnter        = FOUR_CHAR_CODE('pope'),
  886.     kThemeSoundPopupExit        = FOUR_CHAR_CODE('popx'),
  887.     kThemeSoundPopupRelease        = FOUR_CHAR_CODE('popr'),
  888.     kThemeSoundDisclosurePress    = FOUR_CHAR_CODE('dscp'),        /* Disclosure Buttons */
  889.     kThemeSoundDisclosureEnter    = FOUR_CHAR_CODE('dsce'),
  890.     kThemeSoundDisclosureExit    = FOUR_CHAR_CODE('dscx'),
  891.     kThemeSoundDisclosureRelease = FOUR_CHAR_CODE('dscr'),
  892.     kThemeSoundTabPressed        = FOUR_CHAR_CODE('tabp'),        /* Tabs */
  893.     kThemeSoundTabEnter            = FOUR_CHAR_CODE('tabe'),
  894.     kThemeSoundTabExit            = FOUR_CHAR_CODE('tabx'),
  895.     kThemeSoundTabRelease        = FOUR_CHAR_CODE('tabr'),
  896.     kThemeSoundDragTargetHilite    = FOUR_CHAR_CODE('dthi'),        /* drag manager */
  897.     kThemeSoundDragTargetUnhilite = FOUR_CHAR_CODE('dtuh'),
  898.     kThemeSoundDragTargetDrop    = FOUR_CHAR_CODE('dtdr'),
  899.     kThemeSoundEmptyTrash        = FOUR_CHAR_CODE('ftrs'),        /* finder */
  900.     kThemeSoundSelectItem        = FOUR_CHAR_CODE('fsel'),
  901.     kThemeSoundNewItem            = FOUR_CHAR_CODE('fnew'),
  902.     kThemeSoundReceiveDrop        = FOUR_CHAR_CODE('fdrp'),
  903.     kThemeSoundCopyDone            = FOUR_CHAR_CODE('fcpd'),
  904.     kThemeSoundResolveAlias        = FOUR_CHAR_CODE('fral'),
  905.     kThemeSoundLaunchApp        = FOUR_CHAR_CODE('flap'),
  906.     kThemeSoundDiskInsert        = FOUR_CHAR_CODE('dski'),
  907.     kThemeSoundDiskEject        = FOUR_CHAR_CODE('dske'),
  908.     kThemeSoundFinderDragOnIcon    = FOUR_CHAR_CODE('fdon'),
  909.     kThemeSoundFinderDragOffIcon = FOUR_CHAR_CODE('fdof')
  910. };
  911.  
  912. typedef OSType                             ThemeSoundKind;
  913. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  914. /* Window Metrics                                                                            */
  915. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  916. /*     Window metrics are used by the Appearance manager to fill in the blanks necessary to     */
  917. /*     draw windows. If a value is not appropriate for the type of window, be sure to fill in    */
  918. /*     the slot in the structure with zero.    For the popupTabOffset parameter, you can pass a*/
  919. /*     real value based on the left edge of the window. This value might be interpreted in a     */
  920. /*     different manner when depending on the value of the popupTabPosition field. The values    */
  921. /*     you can pass into popupTabPosition are:                                                    */
  922. /*                                                                                            */
  923. /*    kThemePopupTabNormalPosition                                                            */
  924. /*        Starts the tab left edge at the position indicated by the popupTabOffset field.        */
  925. /*                                                                                            */
  926. /*    kThemePopupTabCenterOnWindow                                                            */
  927. /*        tells us to ignore the offset field and instead simply center the width of the         */
  928. /*        handle on the window.                                                                */
  929. /*                                                                                            */
  930. /*    kThemePopupTabCenterOnOffset                                                            */
  931. /*        tells us to center the width of the handle around the value passed in offset.        */
  932. /*                                                                                            */
  933. /*     The Appearance Manager will try its best to accomodate the requested placement, but may */
  934. /*     move the handle slightly to make it fit correctly.                                        */
  935. /*                                                                                            */
  936.  
  937. enum {
  938.     kThemePopupTabNormalPosition = 0,
  939.     kThemePopupTabCenterOnWindow = 1,
  940.     kThemePopupTabCenterOnOffset = 2
  941. };
  942.  
  943.  
  944. struct ThemeWindowMetrics {
  945.     UInt16                             metricSize;                    /* should be always be sizeof( ThemeWindowMetrics )*/
  946.     SInt16                             titleHeight;
  947.     SInt16                             titleWidth;
  948.     SInt16                             popupTabOffset;
  949.     SInt16                             popupTabWidth;
  950.     UInt16                             popupTabPosition;
  951. };
  952. typedef struct ThemeWindowMetrics        ThemeWindowMetrics;
  953. typedef ThemeWindowMetrics *            ThemeWindowMetricsPtr;
  954. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  955. /* Drawing State                                                                            */
  956. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  957. typedef struct OpaqueThemeDrawingState*  ThemeDrawingState;
  958. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  959. /* Callback procs                                                                            */
  960. /*——————————————————————————————————————————————————————————————————————————————————————————*/
  961. typedef CALLBACK_API( void , ThemeTabTitleDrawProcPtr )(const Rect *bounds, ThemeTabStyle style, ThemeTabDirection direction, SInt16 depth, Boolean isColorDev, UInt32 userData);
  962. typedef CALLBACK_API( void , ThemeEraseProcPtr )(const Rect *bounds, UInt32 eraseData, SInt16 depth, Boolean isColorDev);
  963. typedef CALLBACK_API( void , ThemeButtonDrawProcPtr )(const Rect *bounds, ThemeButtonKind kind, ThemeButtonDrawInfo *info, UInt32 userData, SInt16 depth, Boolean isColorDev);
  964. typedef CALLBACK_API( void , WindowTitleDrawingProcPtr )(const Rect *bounds, SInt16 depth, Boolean colorDevice, UInt32 userData);
  965. typedef CALLBACK_API( Boolean , ThemeIteratorProcPtr )(ConstStr255Param inFileName, SInt16 resID, Collection inThemeSettings, void *inUserData);
  966. typedef STACK_UPP_TYPE(ThemeTabTitleDrawProcPtr)                 ThemeTabTitleDrawUPP;
  967. typedef STACK_UPP_TYPE(ThemeEraseProcPtr)                         ThemeEraseUPP;
  968. typedef STACK_UPP_TYPE(ThemeButtonDrawProcPtr)                     ThemeButtonDrawUPP;
  969. typedef STACK_UPP_TYPE(WindowTitleDrawingProcPtr)                 WindowTitleDrawingUPP;
  970. typedef STACK_UPP_TYPE(ThemeIteratorProcPtr)                     ThemeIteratorUPP;
  971. enum { uppThemeTabTitleDrawProcInfo = 0x00036AC0 };             /* pascal no_return_value Func(4_bytes, 2_bytes, 2_bytes, 2_bytes, 1_byte, 4_bytes) */
  972. enum { uppThemeEraseProcInfo = 0x00001BC0 };                     /* pascal no_return_value Func(4_bytes, 4_bytes, 2_bytes, 1_byte) */
  973. enum { uppThemeButtonDrawProcInfo = 0x0001BEC0 };                 /* pascal no_return_value Func(4_bytes, 2_bytes, 4_bytes, 4_bytes, 2_bytes, 1_byte) */
  974. enum { uppWindowTitleDrawingProcInfo = 0x000036C0 };             /* pascal no_return_value Func(4_bytes, 2_bytes, 1_byte, 4_bytes) */
  975. enum { uppThemeIteratorProcInfo = 0x00003ED0 };                 /* pascal 1_byte Func(4_bytes, 2_bytes, 4_bytes, 4_bytes) */
  976. #define NewThemeTabTitleDrawProc(userRoutine)                     (ThemeTabTitleDrawUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppThemeTabTitleDrawProcInfo, GetCurrentArchitecture())
  977. #define NewThemeEraseProc(userRoutine)                             (ThemeEraseUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppThemeEraseProcInfo, GetCurrentArchitecture())
  978. #define NewThemeButtonDrawProc(userRoutine)                     (ThemeButtonDrawUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppThemeButtonDrawProcInfo, GetCurrentArchitecture())
  979. #define NewWindowTitleDrawingProc(userRoutine)                     (WindowTitleDrawingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppWindowTitleDrawingProcInfo, GetCurrentArchitecture())
  980. #define NewThemeIteratorProc(userRoutine)                         (ThemeIteratorUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppThemeIteratorProcInfo, GetCurrentArchitecture())
  981. #define CallThemeTabTitleDrawProc(userRoutine, bounds, style, direction, depth, isColorDev, userData)  CALL_SIX_PARAMETER_UPP((userRoutine), uppThemeTabTitleDrawProcInfo, (bounds), (style), (direction), (depth), (isColorDev), (userData))
  982. #define CallThemeEraseProc(userRoutine, bounds, eraseData, depth, isColorDev)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppThemeEraseProcInfo, (bounds), (eraseData), (depth), (isColorDev))
  983. #define CallThemeButtonDrawProc(userRoutine, bounds, kind, info, userData, depth, isColorDev)  CALL_SIX_PARAMETER_UPP((userRoutine), uppThemeButtonDrawProcInfo, (bounds), (kind), (info), (userData), (depth), (isColorDev))
  984. #define CallWindowTitleDrawingProc(userRoutine, bounds, depth, colorDevice, userData)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppWindowTitleDrawingProcInfo, (bounds), (depth), (colorDevice), (userData))
  985. #define CallThemeIteratorProc(userRoutine, inFileName, resID, inThemeSettings, inUserData)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppThemeIteratorProcInfo, (inFileName), (resID), (inThemeSettings), (inUserData))
  986. /*——————————————————————————————————————————————————————————————————————————————————*/
  987. /* Menu Drawing callbacks                                                            */
  988. /*——————————————————————————————————————————————————————————————————————————————————*/
  989. typedef CALLBACK_API( void , MenuTitleDrawingProcPtr )(const Rect *inBounds, SInt16 inDepth, Boolean inIsColorDevice, SInt32 inUserData);
  990. typedef CALLBACK_API( void , MenuItemDrawingProcPtr )(const Rect *inBounds, SInt16 inDepth, Boolean inIsColorDevice, SInt32 inUserData);
  991. typedef STACK_UPP_TYPE(MenuTitleDrawingProcPtr)                 MenuTitleDrawingUPP;
  992. typedef STACK_UPP_TYPE(MenuItemDrawingProcPtr)                     MenuItemDrawingUPP;
  993. enum { uppMenuTitleDrawingProcInfo = 0x000036C0 };                 /* pascal no_return_value Func(4_bytes, 2_bytes, 1_byte, 4_bytes) */
  994. enum { uppMenuItemDrawingProcInfo = 0x000036C0 };                 /* pascal no_return_value Func(4_bytes, 2_bytes, 1_byte, 4_bytes) */
  995. #define NewMenuTitleDrawingProc(userRoutine)                     (MenuTitleDrawingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMenuTitleDrawingProcInfo, GetCurrentArchitecture())
  996. #define NewMenuItemDrawingProc(userRoutine)                     (MenuItemDrawingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMenuItemDrawingProcInfo, GetCurrentArchitecture())
  997. #define CallMenuTitleDrawingProc(userRoutine, inBounds, inDepth, inIsColorDevice, inUserData)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppMenuTitleDrawingProcInfo, (inBounds), (inDepth), (inIsColorDevice), (inUserData))
  998. #define CallMenuItemDrawingProc(userRoutine, inBounds, inDepth, inIsColorDevice, inUserData)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppMenuItemDrawingProcInfo, (inBounds), (inDepth), (inIsColorDevice), (inUserData))
  999. /*——————————————————————————————————————————————————————————————————————————————————*/
  1000. /*    Appearance Manager APIs                                                            */
  1001. /*——————————————————————————————————————————————————————————————————————————————————*/
  1002. /* Registering Appearance-Savvy Applications */
  1003. EXTERN_API( OSStatus )
  1004. RegisterAppearanceClient        (void)                                                        THREEWORDINLINE(0x303C, 0x0015, 0xAA74);
  1005.  
  1006. EXTERN_API( OSStatus )
  1007. UnregisterAppearanceClient        (void)                                                        THREEWORDINLINE(0x303C, 0x0016, 0xAA74);
  1008.  
  1009. EXTERN_API( Boolean )
  1010. IsAppearanceClient                (const ProcessSerialNumber * process)                        THREEWORDINLINE(0x303C, 0xFFFF, 0xAA74);
  1011.  
  1012. /*****************************************************************************
  1013.     NOTES ON THEME BRUSHES
  1014.     Theme brushes can be either colors or patterns, depending on the theme.
  1015.     Because of this, you should be prepared to handle the case where a brush
  1016.     is a pattern and save and restore the pnPixPat and bkPixPat fields of
  1017.     your GrafPorts when saving the fore and back colors. Also, since patterns
  1018.     in bkPixPat override the background color of the window, you should use
  1019.     BackPat to set your background pattern to a normal white pattern. This
  1020.     will ensure that you can use RGBBackColor to set your back color to white,
  1021.     call EraseRect and get the expected results.
  1022. *****************************************************************************/
  1023.  
  1024. EXTERN_API( OSStatus )
  1025. SetThemePen                        (ThemeBrush             inBrush,
  1026.                                  SInt16                 inDepth,
  1027.                                  Boolean                 inIsColorDevice)                    THREEWORDINLINE(0x303C, 0x0001, 0xAA74);
  1028.  
  1029. EXTERN_API( OSStatus )
  1030. SetThemeBackground                (ThemeBrush             inBrush,
  1031.                                  SInt16                 inDepth,
  1032.                                  Boolean                 inIsColorDevice)                    THREEWORDINLINE(0x303C, 0x0002, 0xAA74);
  1033.  
  1034. EXTERN_API( OSStatus )
  1035. SetThemeTextColor                (ThemeTextColor         inColor,
  1036.                                  SInt16                 inDepth,
  1037.                                  Boolean                 inIsColorDevice)                    THREEWORDINLINE(0x303C, 0x0003, 0xAA74);
  1038.  
  1039. EXTERN_API( OSStatus )
  1040. SetThemeWindowBackground        (WindowPtr                 inWindow,
  1041.                                  ThemeBrush             inBrush,
  1042.                                  Boolean                 inUpdate)                            THREEWORDINLINE(0x303C, 0x0004, 0xAA74);
  1043.  
  1044. /* Window Placards, Headers and Frames */
  1045. EXTERN_API( OSStatus )
  1046. DrawThemeWindowHeader            (const Rect *            inRect,
  1047.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x0005, 0xAA74);
  1048.  
  1049. EXTERN_API( OSStatus )
  1050. DrawThemeWindowListViewHeader    (const Rect *            inRect,
  1051.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x0006, 0xAA74);
  1052.  
  1053. EXTERN_API( OSStatus )
  1054. DrawThemePlacard                (const Rect *            inRect,
  1055.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x0007, 0xAA74);
  1056.  
  1057. EXTERN_API( OSStatus )
  1058. DrawThemeEditTextFrame            (const Rect *            inRect,
  1059.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x0009, 0xAA74);
  1060.  
  1061. EXTERN_API( OSStatus )
  1062. DrawThemeListBoxFrame            (const Rect *            inRect,
  1063.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x000A, 0xAA74);
  1064.  
  1065. /* Keyboard Focus Drawing */
  1066. EXTERN_API( OSStatus )
  1067. DrawThemeFocusRect                (const Rect *            inRect,
  1068.                                  Boolean                 inHasFocus)                            THREEWORDINLINE(0x303C, 0x000B, 0xAA74);
  1069.  
  1070. /* Dialog Group Boxes and Separators */
  1071. EXTERN_API( OSStatus )
  1072. DrawThemePrimaryGroup            (const Rect *            inRect,
  1073.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x000C, 0xAA74);
  1074.  
  1075. EXTERN_API( OSStatus )
  1076. DrawThemeSecondaryGroup            (const Rect *            inRect,
  1077.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x000D, 0xAA74);
  1078.  
  1079. EXTERN_API( OSStatus )
  1080. DrawThemeSeparator                (const Rect *            inRect,
  1081.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x000E, 0xAA74);
  1082.  
  1083. /*—————————————————————————————— BEGIN APPEARANCE 1.0.1 ————————————————————————————————————————————*/
  1084. /* The following Appearance Manager APIs are only available */
  1085. /* in Appearance 1.0.1 or later                             */
  1086. EXTERN_API( OSStatus )
  1087. DrawThemeModelessDialogFrame    (const Rect *            inRect,
  1088.                                  ThemeDrawState         inState)                            THREEWORDINLINE(0x303C, 0x0008, 0xAA74);
  1089.  
  1090. EXTERN_API( OSStatus )
  1091. DrawThemeGenericWell            (const Rect *            inRect,
  1092.                                  ThemeDrawState         inState,
  1093.                                  Boolean                 inFillCenter)                        THREEWORDINLINE(0x303C, 0x0022, 0xAA74);
  1094.  
  1095. EXTERN_API( OSStatus )
  1096. DrawThemeFocusRegion            (RgnHandle                 inRegion,
  1097.                                  Boolean                 inHasFocus)                            THREEWORDINLINE(0x303C, 0x0023, 0xAA74);
  1098.  
  1099. EXTERN_API( Boolean )
  1100. IsThemeInColor                    (SInt16                 inDepth,
  1101.                                  Boolean                 inIsColorDevice)                    THREEWORDINLINE(0x303C, 0x0024, 0xAA74);
  1102.  
  1103. /* IMPORTANT: GetThemeAccentColors will only work in the platinum theme. Any other theme will */
  1104. /* most likely return an error */
  1105. EXTERN_API( OSStatus )
  1106. GetThemeAccentColors            (CTabHandle *            outColors)                            THREEWORDINLINE(0x303C, 0x0025, 0xAA74);
  1107.  
  1108. EXTERN_API( OSStatus )
  1109. DrawThemeMenuBarBackground        (const Rect *            inBounds,
  1110.                                  ThemeMenuBarState         inState,
  1111.                                  UInt32                 inAttributes)                        THREEWORDINLINE(0x303C, 0x0018, 0xAA74);
  1112.  
  1113. EXTERN_API( OSStatus )
  1114. DrawThemeMenuTitle                (const Rect *            inMenuBarRect,
  1115.                                  const Rect *            inTitleRect,
  1116.                                  ThemeMenuState         inState,
  1117.                                  UInt32                 inAttributes,
  1118.                                  MenuTitleDrawingUPP     inTitleProc,
  1119.                                  UInt32                 inTitleData)                        THREEWORDINLINE(0x303C, 0x0019, 0xAA74);
  1120.  
  1121. EXTERN_API( OSStatus )
  1122. GetThemeMenuBarHeight            (SInt16 *                outHeight)                            THREEWORDINLINE(0x303C, 0x001A, 0xAA74);
  1123.  
  1124. EXTERN_API( OSStatus )
  1125. DrawThemeMenuBackground            (const Rect *            inMenuRect,
  1126.                                  ThemeMenuType             inMenuType)                            THREEWORDINLINE(0x303C, 0x001B, 0xAA74);
  1127.  
  1128. EXTERN_API( OSStatus )
  1129. GetThemeMenuBackgroundRegion    (const Rect *            inMenuRect,
  1130.                                  ThemeMenuType             menuType,
  1131.                                  RgnHandle                 region)                                THREEWORDINLINE(0x303C, 0x001C, 0xAA74);
  1132.  
  1133. EXTERN_API( OSStatus )
  1134. DrawThemeMenuItem                (const Rect *            inMenuRect,
  1135.                                  const Rect *            inItemRect,
  1136.                                  SInt16                 inVirtualMenuTop,
  1137.                                  SInt16                 inVirtualMenuBottom,
  1138.                                  ThemeMenuState         inState,
  1139.                                  ThemeMenuItemType         inItemType,
  1140.                                  MenuItemDrawingUPP     inDrawProc,
  1141.                                  UInt32                 inUserData)                            THREEWORDINLINE(0x303C, 0x001D, 0xAA74);
  1142.  
  1143. EXTERN_API( OSStatus )
  1144. DrawThemeMenuSeparator            (const Rect *            inItemRect)                            THREEWORDINLINE(0x303C, 0x001E, 0xAA74);
  1145.  
  1146. EXTERN_API( OSStatus )
  1147. GetThemeMenuSeparatorHeight        (SInt16 *                outHeight)                            THREEWORDINLINE(0x303C, 0x001F, 0xAA74);
  1148.  
  1149. EXTERN_API( OSStatus )
  1150. GetThemeMenuItemExtra            (ThemeMenuItemType         inItemType,
  1151.                                  SInt16 *                outHeight,
  1152.                                  SInt16 *                outWidth)                            THREEWORDINLINE(0x303C, 0x0020, 0xAA74);
  1153.  
  1154. EXTERN_API( OSStatus )
  1155. GetThemeMenuTitleExtra            (SInt16 *                outWidth,
  1156.                                  Boolean                 inIsSquished)                        THREEWORDINLINE(0x303C, 0x0021, 0xAA74);
  1157.  
  1158. /*——————————————————————————————— BEGIN APPEARANCE 1.1 —————————————————————————————————————————————*/
  1159. /*—————————————————————————————————— THEME SWITCHING ———————————————————————————————————————————————*/
  1160. EXTERN_API( OSStatus )
  1161. GetTheme                        (Collection             ioCollection);
  1162.  
  1163. EXTERN_API( OSStatus )
  1164. SetTheme                        (Collection             ioCollection);
  1165.  
  1166. EXTERN_API( OSStatus )
  1167. IterateThemes                    (ThemeIteratorUPP         inProc,
  1168.                                  void *                    inUserData);
  1169.  
  1170. /*———————————————————————————————————————— TABS ————————————————————————————————————————————————————*/
  1171. EXTERN_API( OSStatus )
  1172. DrawThemeTabPane                (const Rect *            inRect,
  1173.                                  ThemeDrawState         inState);
  1174.  
  1175. EXTERN_API( OSStatus )
  1176. DrawThemeTab                    (const Rect *            inRect,
  1177.                                  ThemeTabStyle             inStyle,
  1178.                                  ThemeTabDirection         inDirection,
  1179.                                  ThemeTabTitleDrawUPP     labelProc,
  1180.                                  UInt32                 userData);
  1181.  
  1182. EXTERN_API( OSStatus )
  1183. GetThemeTabRegion                (const Rect *            inRect,
  1184.                                  ThemeTabStyle             inStyle,
  1185.                                  ThemeTabDirection         inDirection,
  1186.                                  RgnHandle                 ioRgn);
  1187.  
  1188. /*——————————————————————————————————————— CURSORS ——————————————————————————————————————————————————*/
  1189. EXTERN_API( OSStatus )
  1190. SetThemeCursor                    (ThemeCursor             inCursor);
  1191.  
  1192. EXTERN_API( OSStatus )
  1193. SetAnimatedThemeCursor            (ThemeCursor             inCursor,
  1194.                                  UInt32                 inAnimationStep);
  1195.  
  1196. /*———————————————————————————————— CONTROL STYLE SETTINGS ——————————————————————————————————————————*/
  1197. EXTERN_API( OSStatus )
  1198. GetThemeScrollBarThumbStyle        (ThemeScrollBarThumbStyle * outStyle);
  1199.  
  1200. EXTERN_API( OSStatus )
  1201. GetThemeScrollBarArrowStyle        (ThemeScrollBarArrowStyle * outStyle);
  1202.  
  1203. EXTERN_API( OSStatus )
  1204. GetThemeCheckBoxStyle            (ThemeCheckBoxStyle *    outStyle);
  1205.  
  1206. /*———————————————————————————————————————— FONTS ———————————————————————————————————————————————————*/
  1207. EXTERN_API( OSStatus )
  1208. UseThemeFont                    (ThemeFontID             inFontID,
  1209.                                  ScriptCode             inScript);
  1210.  
  1211. EXTERN_API( OSStatus )
  1212. GetThemeFont                    (ThemeFontID             inFontID,
  1213.                                  ScriptCode             inScript,
  1214.                                  StringPtr                 outFontName,
  1215.                                  SInt16 *                outFontSize,
  1216.                                  Style *                outStyle);
  1217.  
  1218. /*———————————————————————————————————————— TRACKS ——————————————————————————————————————————————————*/
  1219. EXTERN_API( OSStatus )
  1220. DrawThemeTrack                    (const ThemeTrackDrawInfo * drawInfo,
  1221.                                  RgnHandle                 rgnGhost,
  1222.                                  ThemeEraseUPP             eraseProc,
  1223.                                  UInt32                 eraseData);
  1224.  
  1225. EXTERN_API( Boolean )
  1226. HitTestThemeTrack                (const ThemeTrackDrawInfo * drawInfo,
  1227.                                  Point                     mousePoint,
  1228.                                  ControlPartCode *        partHit);
  1229.  
  1230. EXTERN_API( OSStatus )
  1231. GetThemeTrackBounds                (const ThemeTrackDrawInfo * drawInfo,
  1232.                                  Rect *                    bounds);
  1233.  
  1234. EXTERN_API( OSStatus )
  1235. GetThemeTrackThumbRgn            (const ThemeTrackDrawInfo * drawInfo,
  1236.                                  RgnHandle                 thumbRgn);
  1237.  
  1238. EXTERN_API( OSStatus )
  1239. GetThemeTrackDragRect            (const ThemeTrackDrawInfo * drawInfo,
  1240.                                  Rect *                    dragRect);
  1241.  
  1242. EXTERN_API( OSStatus )
  1243. DrawThemeTrackTickMarks            (const ThemeTrackDrawInfo * drawInfo,
  1244.                                  ItemCount                 numTicks,
  1245.                                  ThemeEraseUPP             eraseProc,
  1246.                                  UInt32                 eraseData);
  1247.  
  1248. EXTERN_API( OSStatus )
  1249. GetThemeTrackThumbPositionFromOffset (const ThemeTrackDrawInfo * drawInfo,
  1250.                                  Point                     thumbOffset,
  1251.                                  SInt32 *                relativePosition);
  1252.  
  1253. EXTERN_API( OSStatus )
  1254. GetThemeTrackThumbPositionFromRegion (const ThemeTrackDrawInfo * drawInfo,
  1255.                                  RgnHandle                 thumbRgn,
  1256.                                  SInt32 *                relativePosition);
  1257.  
  1258. EXTERN_API( OSStatus )
  1259. GetThemeTrackLiveValue            (const ThemeTrackDrawInfo * drawInfo,
  1260.                                  SInt32                 relativePosition,
  1261.                                  SInt32 *                value);
  1262.  
  1263. /*——————————————————————————————————— SCROLLBAR ARROWS —————————————————————————————————————————————*/
  1264. EXTERN_API( OSStatus )
  1265. DrawThemeScrollBarArrows        (const Rect *            bounds,
  1266.                                  ThemeTrackEnableState     enableState,
  1267.                                  ThemeTrackPressState     pressState,
  1268.                                  Boolean                 isHoriz,
  1269.                                  Rect *                    trackBounds);
  1270.  
  1271. EXTERN_API( OSStatus )
  1272. GetThemeScrollBarTrackRect        (const Rect *            bounds,
  1273.                                  ThemeTrackEnableState     enableState,
  1274.                                  ThemeTrackPressState     pressState,
  1275.                                  Boolean                 isHoriz,
  1276.                                  Rect *                    trackBounds);
  1277.  
  1278. EXTERN_API( Boolean )
  1279. HitTestThemeScrollBarArrows        (const Rect *            scrollBarBounds,
  1280.                                  ThemeTrackEnableState     enableState,
  1281.                                  ThemeTrackPressState     pressState,
  1282.                                  Boolean                 isHoriz,
  1283.                                  Point                     ptHit,
  1284.                                  Rect *                    trackBounds,
  1285.                                  ControlPartCode *        partcode);
  1286.  
  1287. /*———————————————————————————————————————— WINDOWS —————————————————————————————————————————————————*/
  1288. EXTERN_API( OSStatus )
  1289. GetThemeWindowRegion            (ThemeWindowType         flavor,
  1290.                                  const Rect *            contRect,
  1291.                                  ThemeDrawState         state,
  1292.                                  const ThemeWindowMetrics * metrics,
  1293.                                  ThemeWindowAttributes     attributes,
  1294.                                  WindowRegionCode         winRegion,
  1295.                                  RgnHandle                 rgn);
  1296.  
  1297. EXTERN_API( OSStatus )
  1298. DrawThemeWindowFrame            (ThemeWindowType         flavor,
  1299.                                  const Rect *            contRect,
  1300.                                  ThemeDrawState         state,
  1301.                                  const ThemeWindowMetrics * metrics,
  1302.                                  ThemeWindowAttributes     attributes,
  1303.                                  WindowTitleDrawingUPP     titleProc,
  1304.                                  UInt32                 titleData);
  1305.  
  1306. EXTERN_API( OSStatus )
  1307. DrawThemeTitleBarWidget            (ThemeWindowType         flavor,
  1308.                                  const Rect *            contRect,
  1309.                                  ThemeDrawState         state,
  1310.                                  const ThemeWindowMetrics * metrics,
  1311.                                  ThemeWindowAttributes     attributes,
  1312.                                  ThemeTitleBarWidget     widget);
  1313.  
  1314. EXTERN_API( Boolean )
  1315. GetThemeWindowRegionHit            (ThemeWindowType         flavor,
  1316.                                  const Rect *            inContRect,
  1317.                                  ThemeDrawState         state,
  1318.                                  const ThemeWindowMetrics * metrics,
  1319.                                  ThemeWindowAttributes     inAttributes,
  1320.                                  Point                     inPoint,
  1321.                                  WindowRegionCode *        outRegionHit);
  1322.  
  1323. EXTERN_API( OSStatus )
  1324. DrawThemeScrollBarDelimiters    (ThemeWindowType         flavor,
  1325.                                  const Rect *            inContRect,
  1326.                                  ThemeDrawState         state,
  1327.                                  ThemeWindowAttributes     attributes);
  1328.  
  1329. /*———————————————————————————————————————— BUTTONS —————————————————————————————————————————————————*/
  1330. EXTERN_API( OSStatus )
  1331. DrawThemeButton                    (const Rect *            inBounds,
  1332.                                  ThemeButtonKind         inKind,
  1333.                                  const ThemeButtonDrawInfo * inNewInfo,
  1334.                                  const ThemeButtonDrawInfo * inPrevInfo,
  1335.                                  ThemeEraseUPP             inEraseProc,
  1336.                                  ThemeButtonDrawUPP     inLabelProc,
  1337.                                  UInt32                 inUserData);
  1338.  
  1339. EXTERN_API( OSStatus )
  1340. GetThemeButtonRegion            (const Rect *            inBounds,
  1341.                                  ThemeButtonKind         inKind,
  1342.                                  const ThemeButtonDrawInfo * inNewInfo,
  1343.                                  RgnHandle                 outRegion);
  1344.  
  1345. EXTERN_API( OSStatus )
  1346. GetThemeButtonContentBounds        (const Rect *            inBounds,
  1347.                                  ThemeButtonKind         inKind,
  1348.                                  const ThemeButtonDrawInfo * inDrawInfo,
  1349.                                  Rect *                    outBounds);
  1350.  
  1351. EXTERN_API( OSStatus )
  1352. GetThemeButtonBackgroundBounds    (const Rect *            inBounds,
  1353.                                  ThemeButtonKind         inKind,
  1354.                                  const ThemeButtonDrawInfo * inDrawInfo,
  1355.                                  Rect *                    outBounds);
  1356.  
  1357.  
  1358. /*————————————————————————————————————— INTERFACE SOUNDS ———————————————————————————————————————————*/
  1359. EXTERN_API( OSStatus )
  1360. PlayThemeSound                    (ThemeSoundKind         kind)                                THREEWORDINLINE(0x303C, 0x0026, 0xAA74);
  1361.  
  1362. EXTERN_API( OSStatus )
  1363. BeginThemeDragSound                (ThemeDragSoundKind     kind)                                THREEWORDINLINE(0x303C, 0x0027, 0xAA74);
  1364.  
  1365. EXTERN_API( OSStatus )
  1366. EndThemeDragSound                (void)                                                        THREEWORDINLINE(0x303C, 0x0028, 0xAA74);
  1367.  
  1368. /*—————————————————————————————————————— PRIMITIVES ————————————————————————————————————————————————*/
  1369. EXTERN_API( OSStatus )
  1370. DrawThemeTickMark                (const Rect *            bounds,
  1371.                                  ThemeDrawState         state);
  1372.  
  1373. EXTERN_API( OSStatus )
  1374. DrawThemeChasingArrows            (const Rect *            bounds,
  1375.                                  UInt32                 index,
  1376.                                  ThemeDrawState         state,
  1377.                                  ThemeEraseUPP             eraseProc,
  1378.                                  UInt32                 eraseData);
  1379.  
  1380. EXTERN_API( OSStatus )
  1381. DrawThemePopupArrow                (const Rect *            bounds,
  1382.                                  ThemeArrowOrientation     orientation,
  1383.                                  ThemePopupArrowSize     size,
  1384.                                  ThemeDrawState         state,
  1385.                                  ThemeEraseUPP             eraseProc,
  1386.                                  UInt32                 eraseData);
  1387.  
  1388. EXTERN_API( OSStatus )
  1389. DrawThemeStandaloneGrowBox        (Point                     origin,
  1390.                                  ThemeGrowDirection     growDirection,
  1391.                                  Boolean                 isSmall,
  1392.                                  ThemeDrawState         state);
  1393.  
  1394. EXTERN_API( OSStatus )
  1395. DrawThemeStandaloneNoGrowBox    (Point                     origin,
  1396.                                  ThemeGrowDirection     growDirection,
  1397.                                  Boolean                 isSmall,
  1398.                                  ThemeDrawState         state);
  1399.  
  1400. EXTERN_API( OSStatus )
  1401. GetThemeStandaloneGrowBoxBounds    (Point                     origin,
  1402.                                  ThemeGrowDirection     growDirection,
  1403.                                  Boolean                 isSmall,
  1404.                                  Rect *                    bounds);
  1405.  
  1406. /*————————————————————————————————————— DRAWING STATE ——————————————————————————————————————————————*/
  1407. /* The following routines help you save and restore the drawing state in a theme-savvy manner. With    */
  1408. /* these weapons in your arsenal, there is no grafport you cannot tame.    Use ThemeGetDrawingState to    */
  1409. /* get the current drawing settings for the current port. It will return an opaque object for you     */
  1410. /* to pass into ThemeSetDrawingState later on. When you are finished with the state, call the        */
  1411. /* ThemeDisposeDrawingState routine. You can alternatively pass true into the inDisposeNow             */
  1412. /* parameter of the ThemeSetDrawingState routine.  You can use this routine to copy the drawing        */
  1413. /* state from one port to another as well.                                                            */
  1414. EXTERN_API( OSStatus )
  1415. NormalizeThemeDrawingState        (void);
  1416.  
  1417. EXTERN_API( OSStatus )
  1418. GetThemeDrawingState            (ThemeDrawingState *    outState);
  1419.  
  1420. EXTERN_API( OSStatus )
  1421. SetThemeDrawingState            (ThemeDrawingState         inState,
  1422.                                  Boolean                 inDisposeNow);
  1423.  
  1424. EXTERN_API( OSStatus )
  1425. DisposeThemeDrawingState        (ThemeDrawingState         inState);
  1426.  
  1427. /*————————————————————————————————————— MISCELLANEOUS ——————————————————————————————————————————————*/
  1428. /* ApplyThemeBackground is used to set up the background for embedded controls     */
  1429. /* It is normally called by controls that are embedders. The standard controls    */
  1430. /* call this API to ensure a correct background for the current theme. You pass */
  1431. /* in the same rectangle you would if you were calling the drawing primitive.    */
  1432. EXTERN_API( OSStatus )
  1433. ApplyThemeBackground            (ThemeBackgroundKind     inKind,
  1434.                                  const Rect *            bounds,
  1435.                                  ThemeDrawState         inState,
  1436.                                  SInt16                 inDepth,
  1437.                                  Boolean                 inColorDev);
  1438.  
  1439. EXTERN_API( OSStatus )
  1440. SetThemeTextColorForWindow        (WindowPtr                 window,
  1441.                                  Boolean                 isActive,
  1442.                                  SInt16                 depth,
  1443.                                  Boolean                 isColorDev);
  1444.  
  1445. EXTERN_API( Boolean )
  1446. IsValidAppearanceFileType        (OSType                 fileType);
  1447.  
  1448. EXTERN_API( OSStatus )
  1449. GetThemeBrushAsColor            (ThemeBrush             inBrush,
  1450.                                  SInt16                 inDepth,
  1451.                                  Boolean                 inColorDev,
  1452.                                  RGBColor *                outColor);
  1453.  
  1454. EXTERN_API( OSStatus )
  1455. GetThemeTextColor                (ThemeTextColor         inColor,
  1456.                                  SInt16                 inDepth,
  1457.                                  Boolean                 inColorDev,
  1458.                                  RGBColor *                outColor);
  1459.  
  1460. /*——————————————————————————————————————————————————————————————————————————————————————————————————*/
  1461. /* Obsolete symbolic names                                                                            */
  1462. /*——————————————————————————————————————————————————————————————————————————————————————————————————*/
  1463. /* Obsolete error codes - use the new ones, s'il vous plait / kudasai */
  1464.  
  1465. enum {
  1466.     appearanceBadBrushIndexErr    = themeInvalidBrushErr,            /* pattern index invalid */
  1467.     appearanceProcessRegisteredErr = themeProcessRegisteredErr,
  1468.     appearanceProcessNotRegisteredErr = themeProcessNotRegisteredErr,
  1469.     appearanceBadTextColorIndexErr = themeBadTextColorErr,
  1470.     appearanceThemeHasNoAccents    = themeHasNoAccentsErr,
  1471.     appearanceBadCursorIndexErr    = themeBadCursorIndexErr
  1472. };
  1473.  
  1474.  
  1475. enum {
  1476.     kThemeActiveDialogBackgroundBrush = kThemeBrushDialogBackgroundActive,
  1477.     kThemeInactiveDialogBackgroundBrush = kThemeBrushDialogBackgroundInactive,
  1478.     kThemeActiveAlertBackgroundBrush = kThemeBrushAlertBackgroundActive,
  1479.     kThemeInactiveAlertBackgroundBrush = kThemeBrushAlertBackgroundInactive,
  1480.     kThemeActiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundActive,
  1481.     kThemeInactiveModelessDialogBackgroundBrush = kThemeBrushModelessDialogBackgroundInactive,
  1482.     kThemeActiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundActive,
  1483.     kThemeInactiveUtilityWindowBackgroundBrush = kThemeBrushUtilityWindowBackgroundInactive,
  1484.     kThemeListViewSortColumnBackgroundBrush = kThemeBrushListViewSortColumnBackground,
  1485.     kThemeListViewBackgroundBrush = kThemeBrushListViewBackground,
  1486.     kThemeIconLabelBackgroundBrush = kThemeBrushIconLabelBackground,
  1487.     kThemeListViewSeparatorBrush = kThemeBrushListViewSeparator,
  1488.     kThemeChasingArrowsBrush    = kThemeBrushChasingArrows,
  1489.     kThemeDragHiliteBrush        = kThemeBrushDragHilite,
  1490.     kThemeDocumentWindowBackgroundBrush = kThemeBrushDocumentWindowBackground,
  1491.     kThemeFinderWindowBackgroundBrush = kThemeBrushFinderWindowBackground
  1492. };
  1493.  
  1494.  
  1495. enum {
  1496.     kThemeActiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterActive,
  1497.     kThemeInactiveScrollBarDelimiterBrush = kThemeBrushScrollBarDelimiterInactive,
  1498.     kThemeFocusHighlightBrush    = kThemeBrushFocusHighlight,
  1499.     kThemeActivePopupArrowBrush    = kThemeBrushPopupArrowActive,
  1500.     kThemePressedPopupArrowBrush = kThemeBrushPopupArrowPressed,
  1501.     kThemeInactivePopupArrowBrush = kThemeBrushPopupArrowInactive,
  1502.     kThemeAppleGuideCoachmarkBrush = kThemeBrushAppleGuideCoachmark
  1503. };
  1504.  
  1505.  
  1506. enum {
  1507.     kThemeActiveDialogTextColor    = kThemeTextColorDialogActive,
  1508.     kThemeInactiveDialogTextColor = kThemeTextColorDialogInactive,
  1509.     kThemeActiveAlertTextColor    = kThemeTextColorAlertActive,
  1510.     kThemeInactiveAlertTextColor = kThemeTextColorAlertInactive,
  1511.     kThemeActiveModelessDialogTextColor = kThemeTextColorModelessDialogActive,
  1512.     kThemeInactiveModelessDialogTextColor = kThemeTextColorModelessDialogInactive,
  1513.     kThemeActiveWindowHeaderTextColor = kThemeTextColorWindowHeaderActive,
  1514.     kThemeInactiveWindowHeaderTextColor = kThemeTextColorWindowHeaderInactive,
  1515.     kThemeActivePlacardTextColor = kThemeTextColorPlacardActive,
  1516.     kThemeInactivePlacardTextColor = kThemeTextColorPlacardInactive,
  1517.     kThemePressedPlacardTextColor = kThemeTextColorPlacardPressed,
  1518.     kThemeActivePushButtonTextColor = kThemeTextColorPushButtonActive,
  1519.     kThemeInactivePushButtonTextColor = kThemeTextColorPushButtonInactive,
  1520.     kThemePressedPushButtonTextColor = kThemeTextColorPushButtonPressed,
  1521.     kThemeActiveBevelButtonTextColor = kThemeTextColorBevelButtonActive,
  1522.     kThemeInactiveBevelButtonTextColor = kThemeTextColorBevelButtonInactive,
  1523.     kThemePressedBevelButtonTextColor = kThemeTextColorBevelButtonPressed,
  1524.     kThemeActivePopupButtonTextColor = kThemeTextColorPopupButtonActive,
  1525.     kThemeInactivePopupButtonTextColor = kThemeTextColorPopupButtonInactive,
  1526.     kThemePressedPopupButtonTextColor = kThemeTextColorPopupButtonPressed,
  1527.     kThemeIconLabelTextColor    = kThemeTextColorIconLabel,
  1528.     kThemeListViewTextColor        = kThemeTextColorListView
  1529. };
  1530.  
  1531.  
  1532. enum {
  1533.     kThemeActiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleActive,
  1534.     kThemeInactiveDocumentWindowTitleTextColor = kThemeTextColorDocumentWindowTitleInactive,
  1535.     kThemeActiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleActive,
  1536.     kThemeInactiveMovableModalWindowTitleTextColor = kThemeTextColorMovableModalWindowTitleInactive,
  1537.     kThemeActiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleActive,
  1538.     kThemeInactiveUtilityWindowTitleTextColor = kThemeTextColorUtilityWindowTitleInactive,
  1539.     kThemeActivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleActive,
  1540.     kThemeInactivePopupWindowTitleColor = kThemeTextColorPopupWindowTitleInactive,
  1541.     kThemeActiveRootMenuTextColor = kThemeTextColorRootMenuActive,
  1542.     kThemeSelectedRootMenuTextColor = kThemeTextColorRootMenuSelected,
  1543.     kThemeDisabledRootMenuTextColor = kThemeTextColorRootMenuDisabled,
  1544.     kThemeActiveMenuItemTextColor = kThemeTextColorMenuItemActive,
  1545.     kThemeSelectedMenuItemTextColor = kThemeTextColorMenuItemSelected,
  1546.     kThemeDisabledMenuItemTextColor = kThemeTextColorMenuItemDisabled,
  1547.     kThemeActivePopupLabelTextColor = kThemeTextColorPopupLabelActive,
  1548.     kThemeInactivePopupLabelTextColor = kThemeTextColorPopupLabelInactive
  1549. };
  1550.  
  1551.  
  1552. enum {
  1553.     kAEThemeSwitch                = kAEAppearanceChanged            /* Event ID's: Theme Switched */
  1554. };
  1555.  
  1556.  
  1557. enum {
  1558.     kThemeNoAdornment            = kThemeAdornmentNone,
  1559.     kThemeDefaultAdornment        = kThemeAdornmentDefault,
  1560.     kThemeFocusAdornment        = kThemeAdornmentFocus,
  1561.     kThemeRightToLeftAdornment    = kThemeAdornmentRightToLeft,
  1562.     kThemeDrawIndicatorOnly        = kThemeAdornmentDrawIndicatorOnly
  1563. };
  1564.  
  1565.  
  1566. enum {
  1567.     kThemeBrushPassiveAreaFill    = kThemeBrushStaticAreaFill
  1568. };
  1569.  
  1570.  
  1571. #if PRAGMA_STRUCT_ALIGN
  1572.     #pragma options align=reset
  1573. #elif PRAGMA_STRUCT_PACKPUSH
  1574.     #pragma pack(pop)
  1575. #elif PRAGMA_STRUCT_PACK
  1576.     #pragma pack()
  1577. #endif
  1578.  
  1579. #ifdef PRAGMA_IMPORT_OFF
  1580. #pragma import off
  1581. #elif PRAGMA_IMPORT
  1582. #pragma import reset
  1583. #endif
  1584.  
  1585. #ifdef __cplusplus
  1586. }
  1587. #endif
  1588.  
  1589. #endif /* __APPEARANCE__ */
  1590.  
  1591.